<template>
  <el-button v-permission="pageCode+functionCode" type="text" @click="handleClick">停用</el-button>
</template>

<script>

export default {
  name: 'TableButtonDisable',
  props: {
    id: {
      type: String,
      required: false,
      default: ''
    },
    pageCode: {
      type: String,
      required: false,
      default: ''
    },
    clickEvent: {
      type: Function,
      required: false,
      default: null
    }
  },
  data() {
    return {
      functionCode: 'disable'
    }
  },
  methods: {
    handleClick() {
      if (this.clickEvent) {
        this.clickEvent()
      } else {
        this.disable(this.id)
      }
    }
  },
  inject: ['disable']
}
</script>

<style scoped>
.main-report_button {
  float: left;
  margin-right: 10px;
}
</style>
